<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.Input-text {
	FONT-WEIGHT: normal;
	COLOR: #000000;
	BACKGROUND-COLOR: #ffffff;
	TEXT-DECORATION: none;
	border: 1px solid #999999;
	height: 16px;
	width:100px;
}
#UserFormDiv{
	width:350px;
	border:1px dotted #A4CDD7;
}
#UserFormDiv .submitDiv{
	width:350px;
	height:50px;
}
#UserFormDiv .submitImage{
	/*float:left;*/
	width:80px;
	height:20px;
	margin:0px auto;
	text-align:center;
	cursor:pointer;
	line-height:20px;
	position:relative;
	background:url('Public/image/button-image.png') 0px 98px;
	font-size:14px;
}
#UserFormDiv table{
	padding-left:20px;
}
#UserFormDiv table tr td{
	height:30px;
}
.tdS1{
	border:1px solid #E3EEFB;
	height:20px;
	line-height:20px;
	width:100px;
}
</style>
<literal>
<script>
$(document).ready(function(){

		//添加行业执行的代码
		var options={
				 beforeSubmit:  showRequest,  
				 success:       showResponse  
		};
		function showRequest(formData, jqForm, options) {    
			if($("#username").val()==""){
				$("#userNameError").html("<img align='absmiddle' src='Public/image/err.gif' />用户不能为空");
				return false;
			}else{
				$("#userNameError").html("<img align='absmiddle' src='Public/image/yes.gif' />");
			}
			if($("#userpwd").val()==""){
				$("#userPwdError").html("<img align='absmiddle' src='Public/image/err.gif' />密码不能为空");
				return false;
			}else{
				$("#userPwdError").html("<img align='absmiddle' src='Public/image/yes.gif' />");
			}
			 return true;
		}  
		function showResponse(responseText, statusText, xhr, $form)  { 
			var _ok=parseInt(responseText);
			if(_ok>=1){
				//pAlert("信息提示","用户保存成功");
				parent.window.location.reload();
				//top.window.location.reload();
			}else{
				pAlert("信息提示","用户保存失败");
				//parent.window.location.reload();
			}
		} 
		$("#saveUser").bind("click",function(){
			if($("#pid").val()==""){
				$('#userForm').attr("action","?m=Admin&a=saveAdd");
			}else{
				$('#userForm').attr("action","?m=Admin&a=saveEdit");
			}
			$('#userForm').ajaxSubmit(options); 
		});
});
function pAlert(title,content){
	 var pop=new Popup({ isClose:true,contentType:4,isReloadOnClose:false,width:200,height:50,isSupportDraging:false,isBackgroundCanClick:true});
     pop.setContent("title",title);
     pop.setContent("alertCon",content);
     pop.build();
     pop.show();
}
</script>

</literal>
<form id="userForm" method="post">
<div id="UserFormDiv">
		<div>
			<table>
				<tr>
					<td width="20%">用户名　:</td>
					<td width="35%" ><input type="hidden" name="data[pid]" id="pid" value="{$data['pid']|default=''}"><input class="Input-text" type="input" name="data[user_name]" id="username" value="{$data['user_name']|default=''}"></td>
					<td width="45%"  align="left" style="line-height:30px"><span id="userNameError" class="tdS"></span></td>
				</tr>
				<tr>
					<td >密码　　:</td>
					<td ><input class="Input-text"  type="password" name="data[user_pwd]" id="userpwd" value="{$data['user_pwd']|default=''}"></td>
					<td align="left" ><span id="userPwdError" ></span></td>
				</tr>
				<tr>
					<td >联系方式:</td>
					<td ><input class="Input-text"  type="input" onkeyup="this.value=this.value.replace(/[^\d|-]/g,'');" name="data[user_phone]" id="userphone" value="{$data['user_phone']|default=''}"></td>
					<td align="left"><span id="userPhoneError" ></span></td>
				</tr>
			</table>
		</div>
		<div class="submitDiv">
			<div class="submitImage" id="saveUser">保存</div>
			<input type="submit" style="display:none" id="submitHangye" >
		</div>
</div>
</form>